<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>版块列表</title>
<load href="__PUBLIC__/css/bootstrap.min.css" />
<load href="__PUBLIC__/css/main.css" />
<load href="__PUBLIC__/css/plate.css" />
<load href="__PUBLIC__/js/jquery-1.9.1.min.js" />
<load href="__PUBLIC__/js/main.js" />
<style type="text/css">
	.position-content{float: right; margin-right: 0px; color: #333; background: none; height: 30px; line-height: 30px; margin-bottom: 0px; padding: 0px;}
	.position-content .searchkey{height: 28px; line-height: 28px; padding: 0px 10px; width: 200px; border-radius: 3px; border: solid 1px #ccc;}
	.position-content .searchbtn{height: 28px; line-height: 26px; background-color: #00A388; color: #fff; border: none; padding: 0px 10px; border-radius: 3px;}
	.careof{position: inherit; clear: both; margin-left: 12px; background-color: #00A388; color: #fff; border: none;}
	.zjiao{position: fixed; width: 100%; height:42px; line-height: 42px; border-top: solid 1px #ccc; background-color: #e7e7e7; bottom: 0px;}
</style>
<script type="text/javascript">
$(function(){
	$("select[name='typearray']").change(function(){
		var v = $(this).children('option:selected').val();
		var p = "__ACTION__/id/"+v+".html";
		location.href=p;
	})
	
	$(".plate_title").each(function(i, element) {
        var t = $(this);
		t.find("li").each(function(j, element) {
            var t1 = $(this);
			t1.mouseover(function(){
				t.siblings().find("li span").hide();
				$(this).siblings().find("span").hide();
				$(this).find("span").show();
			})
			t1.mouseout(function(){
				$(this).find("span").hide();	
			})
			t1.find("span").mouseout(function(){
				$(this).hide();	
			})
        });
    });

	$("li").each(function(i, element) {
		var t = $(this);
		if(t.find("b").length < 1){
			t.find("a.pbrowse").hide();
		}
	});

	//转交事件
	var jur = '';
	$("a.careof").click(function(){
		$('input[name="jur"]:checked').each(function(index, element) {
			jur += $(this).val()+",";
		});
		if(jur != ''){
			if(jur.indexOf(",") > 0){
				var s = jur.substring(0,jur.length-1);
			}else{
				var s = jur;
			}
			$(".user_tar").show();
			$("input[name='ma_id']").val(s);
		}
		jur = '';
		//alert($("input[name='ma_id']").val());
	})
	//关闭窗口
	$(".user_info b").click(function(){
		$("input[name='ma_id']").val(null);
		$(".user_tar").hide();
	})
	//执行转交
	$("a.user_ok").click(function(){
		var ma_id = $("input[name='ma_id']").val();
		var user_id = $(".user_info select").val();
		var geturl = $("input[name='geturl']").val();
		if(user_id !='' && ma_id != ''){
			var url = "/Admin/Manages/jur";
			var data = {
				"ma_id":ma_id,
				"user_id":user_id,
				random:Math.random()
			};
			$.ajax({
				url:url,
				data:data,
				type:"POST",
				dataType:"JSON",
				success:function (data){
					if(data.error == 0){
						alert("转交成功");
						location.href = geturl;
					}else{
						alert("转交失败");
					}
				},
			});
		}
	})

	$(".plate_frame").each(function(index, element){
		var plateul = $(this).find("ul").html();
		if(plateul == ''){
			$(this).remove();
		}
	})
	
})
</script>
</head>

<body>
<assign name="account_value_1" value="1"/>
<assign name="account_value_2" value="2"/>
<!-- 用户列表开始 -->
<div class="user_tar">
	<div class="user_info" style="width: 360px; padding: 10px 20px; height: 52px;">
		<b>X</b>
		<label class="u_float">用户列表：</label>
		<select class="u_float" name="userinfo">
			<volist name="userlist" id="user">
				<option value="{$user['id']}">{$user['username']}</option>
			</volist>
		</select>
		<a class="u_float user_ok">确定</a>
		<input type="hidden" name="ma_id"/>
		<input type="hidden" name="geturl" value="{$getURL}"/>
	</div>
</div>
<!-- 用户列表结束 -->

<assign name="user_jur" value="$Think.session.userinfo.id"/>
<div class="main-frame">
	<div class="position">华人码 > 版块列表</div>

	<div class="plate_all" style="margin-bottom: 200px;">
		<div class="explain">
			说明：<b>●</b>点表示有多少个子版块数量
			<div class="position-content">
				<form name="form3" id="form3" method="post" action="{:U('search')}">
					<label>资源搜索：</label>
					<input name="key" class="searchkey skeyma" placeholder="搜索资源"></input>
					<input class="searchbtn searchma" type="submit" name="search" value="资源搜索"></input>
				</form>
			</div>
		</div>

		<if condition="$Thinkphp.session.userinfo.type eq 1">
    	<div class="plate_outline color1" style="margin-top: 0px;">★ 网络资源<a href="{:U('plate_add', array('typeid' => 1))}" style="display: none;">┣ 添加版块</a></div>
        <div class="plate_title">
            <ul>
                <volist name="data" id="v">
                    <if condition="$v['plate_type'] eq 1">
                        <li>
							{:W('Plate/get_subpalte_num', array('plateid' => $v['id']))}<a>⊙ {$v['plate_name']}</a>
							<span>
								<if condition="$user_jur eq 1">
									<a href="{:U('plate_edit',array('id' => $v['id'], 'pedit' => 'true'))}">◆ 修改</a>
									<a href="{:U('plate_delete',array('id' => $v['id']))}" onclick="javascript:return del()">◆ 删除</a>
								</if>
								<a class="pbrowse" href="{:U('Manages/plate_browse', array('typeid' => 1, 'id' => $v['id'], 'sub' => 'true'))}">◆ 查看子版块</a>
							</span>
						</li>
                    </if>
                </volist>
            </ul>
        </div>
		</if>

        <in name="account_value_1" value="$accounttype">
        <div class="plate_outline color2">★ 企业资源<a href="{:U('plate_add', array('typeid' => 2))}">┣ 添加版块</a></div>
        <div class="plate_title plate_custom">
        	<ul>
				<volist name="data" id="v">
					<if condition="($v['userid'] eq $user_jur) or ($Thinkphp.session.userinfo.type eq 1)">
						<if condition="$v['plate_type'] eq 2">
							<li style="width: 200px;">
								{:W('Plate/get_subpalte_num', array('plateid' => $v['id']))}<a title="{$v['plate_name']}"><if condition="$Thinkphp.session.userinfo.type eq 1"><input type="checkbox" value="{$v.id}" name="jur" /></if> ⊙ {$v['plate_name']|msubstr=0,8}</a>
								<span>
									<if condition="($v['userid'] eq $user_jur) or ($Thinkphp.session.userinfo.type eq 1)">
									<a href="{:U('plate_edit',array('id' => $v['id'], 'pedit' => 'true'))}">◆ 修改</a>
									<a href="{:U('plate_delete',array('id' => $v['id']))}" onclick="javascript:return del()">◆ 删除</a>
									<a href="{:U('plate_add', array('typeid' => 2, 'id' => $v['id'], 'sub' => 'true'))}">◆ 添加子版块</a>
									<a class="pbrowse" href="{:U('Manages/plate_browse', array('typeid' => 2, 'id' => $v['id'], 'sub' => 'true'))}">◆ 查看子版块</a>
									<a href="{:U('Pcontent/content_add', array('id' => $v['id']))}">◆ 添加内容</a>
									</if>
									<a href="{:U('Pcontent/content_list', array('id' => $v['id']))}">◆ 内容列表</a>
								</span>
							</li>
						</if>
					</if>
				</volist>
            </ul>
        </div>
    	</in>
        
        <in name="account_value_2" value="$accounttype">
        <div class="plate_outline color3">★ 政府资源<a href="{:U('plate_add', array('typeid' => 3))}">┣ 添加省份</a></div>
		<volist name="data" id="v">
			<if condition="$v['plate_type'] eq 3">
				<div class="plate_frame">
					<span class="plate_province">● {$v['plate_name']}<a href="{:U('plate_add', array('typeid' => 3, 'id' => $v['id'], 'sub' => 'true'))}">┣ 添加地级市</a></span>
					<div class="plate_title plate_title_bottomnone">
						<ul>
							<volist name="v['subplate']" id="list1">
								<li>
									{:W('Plate/get_subpalte_num', array('plateid' => $list1['id']))}<a><if condition="$Thinkphp.session.userinfo.type eq 1"><input type="checkbox" value="{$list1.id}" name="jur" /></if>⊙ {$list1['plate_name']}</a>
									<span>
										<if condition="($list1['userid'] eq $user_jur) or ($Thinkphp.session.userinfo.type eq 1)">
											<a href="{:U('plate_edit',array('id' => $list1['id'], 'pedit' => 'true'))}">◆ 修改</a>
											<a href="{:U('plate_delete',array('id' => $list1['id']))}" onclick="javascript:return del()">◆ 删除</a>
											<a href="{:U('plate_add', array('typeid' => 3, 'id' => $list1['id'], 'sub' => 'true'))}">◆ 添加子版块</a>
											<a class="pbrowse" href="{:U('Manages/plate_browse', array('typeid' => 3, 'id' => $list1['id'], 'sub' => 'true'))}">◆ 查看子版块</a>
											<a  href="{:U('Pcontent/content_add', array('id' => $v['id']))}">◆ 添加内容</a>
										</if>
										<a href="{:U('Pcontent/content_list', array('id' => $v['id']))}">◆ 内容列表</a>
									</span>
								</li>
							</volist>
						</ul>
					</div>
				</div>
			</if>
		</volist>
		</in>
        
        
    </div>
    
</div>

<div class="zjiao"><if condition="$Thinkphp.session.userinfo.type eq 1"><a class="careof" style="color: #fff;">转交</a></if></div>


<script type="text/javascript">
function del() { 
	var msg = "您真的确定要删除吗？\n\n请确认！"; 
	return confirm(msg) == true ? true : false;
}
</script>
</body>
</html>
